package com.totem.base.constants;

import java.math.BigDecimal;
import java.time.format.DateTimeFormatter;
import java.util.regex.Pattern;

/**
 * @author raymond
 * @version V1.0
 */
public class CommonConstants {
    public static final String APP_ID = "APP123456";
    public static final String DEFAULT_PWD = "12345678";
    public static final String DEFAULT_TX_PWD = "123456";
    // 超级管理员
    public static final String DEFAULT_ADMIN = "admin";
    // 财务账户
    public static final String DEFAULT_FINANCIAL = "financial";
    // 运营账户
    public static final String DEFAULT_OPERATION = "operation";
    public static final Integer APP_MAX_LOG_LENGTH = 100000;
    public static final String DEFAULT_DATE_FORMAT = "yyyyMMdd";
    public static final DateTimeFormatter DEFAULT_DATE_FORMATTER = DateTimeFormatter.ofPattern(DEFAULT_DATE_FORMAT);
    public static final String DEFAULT_DATETIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
    public static final DateTimeFormatter DEFAULT_DATETIME_FORMATTER = DateTimeFormatter.ofPattern(DEFAULT_DATETIME_FORMAT);
    public static final String DEFAULT_MS_FORMAT = "yyyy-MM-dd HH:mm:ss.SSS";
    public static final DateTimeFormatter DEFAULT_MS_FORMATTER = DateTimeFormatter.ofPattern(DEFAULT_MS_FORMAT);
    public static final String LOGIN_TYPE_KEY = "loginType";
    public static final String LOGIN_NICKNAME_KEY = "nickname";
    public static final String LOGIN_COUNTRYCODE_KEY = "countryCode";
    public static final String LOGIN_MOBILE_KEY = "mobile";
    public static final String LOGIN_EMAIL_KEY = "email";
    public static final String LOGIN_PASSWORD_KEY = "password";

    public static final String PARAMS_KEY = "params";
    public static final String PARAMS_TEMPLATE = "?"+PARAMS_KEY+"={"+PARAMS_KEY+"}";

    public static final boolean ENCRYPT_ENABLE = true;
    public static final String SYMMETRY_HEADER_CRYPTO = "CRYPTO";
    public static final String SYMMETRY_HEADER_IV = "IV";
    public static final String SYMMETRY_HEADER_SIGN = "SIGN";

    public static final String SIGN_SECRET_KEY = "SECRET_KEY";

    public static final String SIGN_NONCE_KEY = "NONCE";
    public static final String SIGN_TIMESTAMP_KEY = "TIMESTAMP";
    public static final String SIGN_TYPE_KEY = "SIGN_TYPE";
    public static final String SIGN_KEY = "KEY";

    public static final String CLIENT_REQUEST_TIME = "CLIENT_REQUEST_TIME";
    public static final String REQUEST_TO_GATEWAY = "REQUEST_TO_GATEWAY";
    public static final String TRACE_ID = "Trace_Id";

    public static final BigDecimal HUNDRED = new BigDecimal("100");

    public static final Long ETHER2WEI = 1_000_000_000_000_000_000L;
    public static final String ETHER2WEI_STRING = "1000000000000000000";
    public static final Long ETHER2GWEI = 1_000_000_000L;
    public static final String ETHER2GWEI_STRING = "1000000000";

    // 默认通用精度
    public static final int DEFAULT_SCALE = 4;
    // 默认收益奖励精度
    public static final int DEFAULT_RETURN_AWARD_SCALE = 4;

    // all digit
    public static final Pattern DIGITAL = Pattern.compile("^[-\\+]?[\\d]*$");

    // file
    public static final String DEFAULT_AVATAR_URL = "https://tuteng13.s3.ap-northeast-2.amazonaws.com/game/imgs/default-avatar.png";
    public static final String FILE_PREFIX = "ipo/";
    public static final String FILE_COVER_PREFIX = FILE_PREFIX+"cover/";
    public static final String FILE_CAROUSEL_PREFIX = FILE_PREFIX+"carousel/";
    public static final String FILE_VIDEO_PREFIX = FILE_PREFIX+"video/";
    public static final Integer MAX_IN_MEMORY_SIZE = 200*1024*1024;
    public static final Integer MAX_UPLOAD_SIZE = 200*1024*1024;
}
